<template>
  <div class="app">
    <div class="searchbox">
      <van-icon name="arrow-left" class="arrowicon" @click="backlink" />
      <van-search
        v-model="searchvalue"
        class="searchinput"
        ref="searchInput"
        placeholder="请输入搜索关键词"
      />
      <div class="searchbtn">搜索</div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      searchvalue: "",
    };
  },
  methods: {
    backlink() {
      this.$router.back();
    },
  },
  mounted() {
    this.$refs.searchInput.focus();
  },
};
</script>

<style scoped>
.app {
  margin: 0;
  padding: 0;
  background-color: #ffffff;
}
.searchbox {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.arrowicon {
  font-size: 30px;
  line-height: 60px;
  color: gray;
}
.searchinput {
  flex-grow: 1;
}
.searchbtn {
  line-height: 60px;
  font-size: 18px;
  color: gray;
  margin-right: 10px;
}
</style>
<style>
.searchinput .van-search__content {
  border-radius: 25px !important;
}
</style>